Skip to content

fix(core): own-property lookups for CodeMode fetch response headers (#805) - #808

Merged
dezren39 merged 1 commit into
mainfrom
queue/2969-805-codemode-headers
Oct 29, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/2969-805-codemode-headers

Conversation

@dezren39

@dezren39 dezren39 commented Oct 29, 2026 •

Copy link
Copy Markdown

Fixes #805

The CodeMode fetch shim built response headers with Object.fromEntries (a plain Object.prototype-backed record) and read them with [] and the in operator, so absent headers whose lowercased names collide with all-lowercase prototype members read as present: get('constructor') returned the Object function, get('__proto__') returned Object.prototype, and has() returned true for both.

Fix (packages/core/src/codemode/web.ts): own-property lookups only, following the #792/#793 precedent — get/has now guard with Object.hasOwn. entries() is unchanged, and a header actually sent under a prototype name (e.g. a literal constructor header) still resolves to its string value, because Object.fromEntries defines it as an own property.

Regression test (packages/core/test/codemode/web.test.ts): serves a real response via Bun.serve carrying only content-type and x-real, and pins constructor/__proto__ to null/false, ordinary present/absent headers to their previous behavior, and a genuinely sent constructor header to its value.

Verification:

  • Laptop (worktree ~/git/fleet/2969-805-codemode-headers): new test fails on pre-fix code (1 fail), passes with the fix (2/2); full codemode suite 26/26 pass.
  • CI on this PR is the remaining check.

Queue: task 2969 (repo-health-opencode-pilot), lane B worker shift.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb6146da-f7bd-494b-8f13-7425aa27c40f
Commits

Reviewing files that changed from the base of the PR and between 67ea7ed and d5cd837.

Files selected for processing: 2
  • packages/core/src/codemode/web.ts
  • packages/core/test/codemode/web.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T01:58:11.093667Z d5cd837 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@dezren39
dezren39 merged commit 9a8652b into main Oct 29, 2026
19 of 25 checks passed
@dezren39
dezren39 deleted the queue/2969-805-codemode-headers branch November 1, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant